var text = JSON.stringify(sessionStorage);
// console.log(text);
function download(
    data,
    name = '',
    { type = 'text/plain', encode, timestamp = false } = {}
    ) {
    
    return new Promise((resolve, reject) => {
        if (!data) return
    
        try {
        let blob
        const a = document.createElement('a')
        a.style.display = 'none'
        a.download = name + (timestamp ? `_${Date.now()}` : '')
    
        if (/^https?|ftp|data:/.test(data)) {
            a.href = data
        } else {
            blob =
            data instanceof Blob
                ? data
                : new Blob(data instanceof Array ? data : [data], {
                    type: type + (encode ? ';charset=' + encode : '')
                })
            a.href = URL.createObjectURL(blob)
        }
    
        setTimeout(() => {
            a.click()
            setTimeout(() => {
            a.remove()
            resolve()
            if (blob instanceof Blob) {
                setTimeout(() => {
                URL.revokeObjectURL(blob)
                }, 1000)
            }
            }, 1)
        }, 0)
        } catch (error) {
        reject(error)
        }
    })
}
download(text,("政协session数据"+sessionStorage["areaNamehenanzxjava"]+".json").replaceAll("_",""))